Parentheses (curved marks) can be used to group arguments in an eval expression. Parentheses clarify the order of expressions, i.e., the eval command evaluates the parts of expression within the parentheses at first.
Example:
| process eval("Profit_percent=(Selling_price-cost_price)/cost_price * 100")
| fields Selling_price, cost_price, Profit_percent
The above example calculates the specified arithmetic expression and returns its value in the Profit_percent identifier. While performing the calculation, the function first evaluates the part of the expression within the parentheses, (Selling_price-cost_price), then it uses this result in the rest of the expression.
The fields command displays the value of Selling_price, cost_price, and Profit_percent in a tabular form.
Expression with parentheses¶
We are glad this guide helped.
Please don't include any personal information in your comment
Contact Support